import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-09-09
 * Time: 17:59
 */
public class Test {
    public static void main(String[] args) {
        Set<Integer> set=new TreeSet<>();
        set.add(1);
        set.add(2);
        set.add(3);
        ArrayList<Integer> arrayList=new ArrayList<>();
        arrayList.add(1);
        arrayList.add(2);
        arrayList.add(4);
        //boolean ret=set.containsAll(arrayList);
        //System.out.println(ret);
        set.addAll(arrayList);
        System.out.println(set);
    }
    public static void main3(String[] args) {
        Map<String,Integer> map=new HashMap<>();
        map.put("haha",12);
        map.put("xixi",2);
        map.put("dodo",22);
        Set<String> set=map.keySet();
        System.out.println(set);
        Collection<Integer> collection=map.values();
        System.out.println(collection);

    }
    public static void main2(String[] args) {
        Map<String,Integer> map=new HashMap<>();
        map.put("abc",2);
        map.put("hello",3);
        map.put("bala",6);
        System.out.println(map);
        //for(Map.Entry<String,Integer> entry : )

    }
    public static void main1(String[] args) {
        Map<String,Integer> map=new TreeMap<>();
        map.put("abc",3);
        map.put("hello",2);
        map.put("bb",2);

        Set<String> set=map.keySet();
        for(String s : set){
            System.out.print(s+" ");
        }
        System.out.println();

        Collection<Integer> collection=map.values();
        for(Integer i : collection){
            System.out.print(i+" ");
        }
        System.out.println();

        Set<Map.Entry<String,Integer>> set2=map.entrySet();
        for(Map.Entry<String,Integer> node: set2){
            System.out.print(node+" ");
        }
        System.out.println();

        Set<Integer> set3=new TreeSet<>();
        Collection<Integer> collection1=new ArrayList<>();
        collection1.add(1);
        collection1.add(2);
        collection1.add(2);
        collection1.add(3);
        set3.addAll(collection1);
        for(Integer i : set3){
            System.out.print(i+" ");
        }
        System.out.println();
    }
}
